package com.foshanshop.ejb3.dao;

import com.dhgate.persist.Session;
import com.foshanshop.ejb3.dao.impl.DalDAOImpl;
import com.foshanshop.ejb3.dao.impl.OracleDAOImpl;

public class DAOFactory  extends AbstractDAOFactory2{

    private static DAOFactory me;
 
    
    protected static DAOFactory getInstance(){
        if (null==me){
            me = new DAOFactory();
        }
        return me;
    }

    public static DalDAO getDalDAO() {
        DalDAO instance =getInstance().getDAO(DalDAOImpl.class);
        instance.setSession(new Session(getDaoToSessionFactory(DalDAOImpl.class).getCurrentSession()));
        return instance;
    }
    
    public static OracleDAO getOracleDAO() {
        OracleDAO instance =getInstance().getDAO(OracleDAOImpl.class ,true);
//        instance.setSession(new Session(getDaoToSessionFactory(OracleDAOImpl.class).getCurrentSession()));
        return instance;
    }
 
}
